const bodyParser = require("body-parser");
const express = require("express");

const app = express();
const jsonParser = bodyParser.json();
const urlencodeParser = bodyParser.urlencoded({ extended: false });

app.get("/login", (req, res) => {
  res.sendFile(__dirname + "/form.html");
});

app.post("/login", urlencodeParser, (req, res) => {
  console.log(req.body);
  res.send("获取用户的数据");
});

app.listen(3000, () => {
  console.log("服务已经启动，端口 3000 正在监听中....");
});
